import os
from test import *



testcase_list = set([ os.path.basename(fname).split('.')[0] for fname in os.listdir('./testdata/') if os.path.isfile(os.path.join('./testdata/', fname))]) - set(['__init__'])

passed_num = 0
for testcase in testcase_list:
    py = './testdata/' + testcase + '.py'
    std = './testdata/' + testcase + '.ans'
    input_file = './testdata/' + testcase + '.in'

    verdict, msg = TestCase(input_file, std, py).go()
    print(testcase + ": ", msg)
    if not verdict:
        break
    passed_num += 1

print("{} / {} passed".format(passed_num, len(testcase_list)))